﻿<UserControl x:Class="VKontakteClient.LogOnControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="LoginControl_Loaded" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">
	<UserControl.Resources>
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#F3F3F3" Offset="0"/>
			<GradientStop Color="#EBEBEB" Offset="0.5"/>
			<GradientStop Color="#DDDDDD" Offset="0.5"/>
			<GradientStop Color="#CDCDCD" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
		<Style TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" Background="#FFFFFFFF">
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
						</Microsoft_Windows_Themes:ButtonChrome>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
								<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="ToggleButton.IsChecked" Value="true">
								<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
    <Border CornerRadius="15" Background="AliceBlue" BorderBrush="Black" BorderThickness="1">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Label Content="" x:Name="Message" Grid.ColumnSpan="2" Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center" />
            <Label Content="Вход в ВКонтакте" Grid.ColumnSpan="2" Margin="10" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
            <Label Content="E-Mail:" Grid.Row="1" Margin="10" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
            <Label Content="Пароль:" Grid.Row="2" Margin="10" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
            <TextBox Grid.Column="1" Grid.Row="1" Margin="10" VerticalAlignment="Center" x:Name="EMail" Width="150" Text="" />
            <PasswordBox Grid.Column="1" Grid.Row="2" Margin="10" VerticalAlignment="Center" x:Name="Pass" Width="150" />
            <StackPanel Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical" Visibility="Collapsed" x:Name="CaptchaStack">
                <Label Content="Captcha:" Grid.Row="3" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                <Image x:Name="CaptchaImg" />
            </StackPanel>
            <TextBox Grid.Column="1" Grid.Row="3" Margin="10" VerticalAlignment="Center" x:Name="Captcha" Visibility="Collapsed"/>
            <StackPanel Grid.Row="5" Grid.ColumnSpan="2" Orientation="Horizontal" >
                <Button x:Name="AuthorizeButton1" Margin="10" HorizontalAlignment="Center" VerticalAlignment="Center" Click="AuthorizeButton1_Click">
                    <Label Content="Вход через IE" Margin="10,0,10,0"/>
                </Button>
                <Button x:Name="AuthorizeButton" Margin="10" HorizontalAlignment="Center" VerticalAlignment="Center" Click="Authorize" >
                    <Label Content="Вход" Margin="10,0,10,0"/>
                </Button>
                <Button x:Name="AuthorizeButton2" Margin="10" HorizontalAlignment="Center" VerticalAlignment="Center" Click="AuthorizeButton2_Click">
                    <Label Content="Оффлайн-режим" Margin="10,0,10,0"/>
                </Button>
            </StackPanel>
        </Grid>
    </Border>
</UserControl>
